package com.ktjiaoyu.ktmall.service;

import com.ktjiaoyu.ktmall.entity.Product;
import com.ktjiaoyu.ktmall.utils.Page;

import java.sql.SQLException;
import java.util.List;

public interface ProductService {
    /**
     * 分页查询
     * */
    Page<Product> findList(String title, Long categoryId, int pageNo, int pageSize) throws SQLException;
    /**
     * 获取总记录数
     * */
    int count (String title,Long categoryId) throws SQLException;


    Product findById(Long id) throws SQLException;
    /**
     * 新增或修改商品
     */
    boolean saveOrUpdate(Product entity) throws SQLException;

    /**
     * 删除商品
     * */
    boolean removeById(Long id) throws SQLException;

    /**
     * 修改商品状态
     * */
    boolean updateStatus(Long id, Integer status) throws SQLException;
}
